<template>
	<el-main>
		<el-row :gutter="20">
			<el-col :span="10" :offset="6">
				<div class="detail-title">
					详情
				</div>
				<el-form :model="form" ref="form">
					<el-form-item label="请求方法" prop="requestMethod">
						<el-input v-model="form.requestMethod" readonly></el-input>
					</el-form-item>
					<el-form-item label="请求IP" prop="requestIp">
						<el-input v-model="form.requestIp" readonly></el-input>
					</el-form-item>
					<el-form-item label="请求URL" prop="requestUrl">
						<el-input v-model="form.requestUrl" readonly></el-input>
					</el-form-item>
					<el-form-item label="类名" prop="className">
						<el-input v-model="form.className" readonly></el-input>
					</el-form-item>
					<el-form-item label="方法名" prop="methodName">
						<el-input v-model="form.methodName" readonly></el-input>
					</el-form-item>
					<el-form-item label="Value" prop="value">
						<el-input v-model="form.value" readonly></el-input>
					</el-form-item>
					<el-form-item label="Description" prop="description">
						<el-input v-model="form.description" readonly></el-input>
					</el-form-item>
					<el-form-item label="请求参数" prop="parameters">
						<el-input type="textarea" autosize v-model="form.parameters" readonly></el-input>
					</el-form-item>
					<el-form-item label="返回值" prop="returnValue">
						<el-input type="textarea" autosize v-model="form.returnValue" readonly></el-input>
					</el-form-item>
					<el-form-item label="请求耗时" prop="executeTime">
						<el-input v-model="form.executeTime+'毫秒'" readonly></el-input>
					</el-form-item>
				</el-form>
			</el-col>
		</el-row>
	</el-main>
</template>

<script>
	import { getSystemLogById } from '@/api/system_log.js'
	export default {
		data() {
			return {
				form: {}
			}
		},
		mounted() {
			if (this.$route.query.logId) {
				this.getSystemLogById(
					this.$route.query.logId
				);
			}
		},
		methods: {
			// 详情信息
			getSystemLogById(logId) {
				let _this = this;
				getSystemLogById({'logId': logId}).then(function(res){
					if (res.code === 200) {
						_this.form = res.data;
					}
				})
			}
		}
	}
</script>
